﻿using System.Collections.Generic;

namespace WPF数据采集系统.MesClass
{
    #region 上传设备状态 set_device_status
    public class SetDeviceStatusParam
    {
        /// <summary>
        /// 设备编码
        /// </summary>
        public string device_code { get; set; }
        /// <summary>
        /// 设备状态
        /// </summary>
        public string status { get; set; }
        /// <summary>
        /// 异常代码
        /// </summary>
        public string errcode { get; set; }
        /// <summary>
        /// 状态信息
        /// </summary>
        public string msg { get; set; }
    }
    public class SetDeviceStatus
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 接口参数
        /// </summary>
        public SetDeviceStatusParam param { get; set; }
    }
    public class ResultSetDeviceStatus
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 返回码
        /// </summary>
        public int errcode { get; set; }
        /*
           0：请求成功
           4001：请求失败，输入参数结构验证失败
           4002：请求失败，输入数据错误或 冲突         
       */
        /// <summary>
        /// 错误信息
        /// </summary>
        public string errmsg { get; set; }// errcode 不为0，errmsg才有错误信息
        /// <summary>
        /// 返回结果
        /// </summary>
        public string rtval { get; set; }
    }
    #endregion

    #region 获取托盘路由 get_process_route
    /// <summary>
    /// 获取托盘路由参数
    /// </summary>
    public class GetProcessRouteParam
    {
        /// <summary>
        /// 托盘号
        /// </summary>
        public string tray { get; set; }
    }
    /// <summary>
    /// 获取托盘路由
    /// </summary>
    public class GetProcessRoute
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 接口参数
        /// </summary>
        public GetProcessRouteParam param { get; set; }
    }
    /// <summary>
    /// 输出参数
    /// </summary>
    public class ResultGetProcessRouteRtval
    {
        /// <summary>
        /// 生产批次
        /// </summary>
        public string batch { get; set; }
        /// <summary>
        /// 子批次
        /// </summary>
        public string unit_batch { get; set; }
        /// <summary>
        /// 流水号
        /// </summary>
        public string lot { get; set; }
        /// <summary>
        /// 上一工序编码
        /// </summary>
        public string lastProcess { get; set; }
        /// <summary>
        /// 下一工序编码
        /// </summary>
        public string nextProcess { get; set; }//需要判定托盘下一工作站是否为 SELECTION
        /// <summary>
        /// 上一工作站
        /// </summary>
        public string lastWorkstation { get; set; }
        /// <summary>
        /// 下一工作站
        /// </summary>
        public string nextWorkstation { get; set; }
        /// <summary>
        /// 投入电池数量
        /// </summary>
        public int inputBatteryCount { get; set; }
    }
    /// <summary>
    /// 托盘路由 返回结果
    /// </summary>
    public class ResultGetProcessRoute
{
        /// <summary>
        /// 
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int errcode { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string errmsg { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public ResultGetProcessRouteRtval rtval { get; set; }
    }
    #endregion

    #region 获取托盘信息[获取托盘内所有电池档位信息]（通用返回接口信息）
    /// <summary>
    /// 获取托盘信息参数
    /// </summary>
    public class GetTrayInfoParam
    {
        /// <summary>
        /// 托盘信息
        /// </summary>
        public string tray { get; set; }
    }
    /// <summary>
    /// 获取托盘信息
    /// </summary>
    public class GetTrayInfo
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 接口参数
        /// </summary>
        public GetTrayInfoParam param { get; set; }
    }
    /// <summary>
    /// 获取托盘信息输出结果参数
    /// </summary>
    public class ResultGetTrayInfoRtval
    {
        /// <summary>
        /// 生产批次
        /// </summary>
        public string batch { get; set; }
        /// <summary>
        /// 子批次
        /// </summary>
        public string unit_batch { get; set; }
        /// <summary>
        /// 流水号
        /// </summary>
        public string lot { get; set; }
        /// <summary>
        /// 托盘号
        /// </summary>
        public string tray { get; set; }
        /// <summary>
        /// 是否整盘NG
        /// </summary>
        public string tray_ng { get; set; }
        /// <summary>
        /// 整盘NG类别
        /// </summary>
        public string tray_ng_class { get; set; }
        /// <summary>
        /// 整盘NG设备
        /// </summary>
        public string tray_ng_device { get; set; }
        /// <summary>
        /// 电池编码
        /// </summary>
        public List<string> battery_ids { get; set; }
        /// <summary>
        /// 电池激活状态
        /// </summary>
        public List<int> active { get; set; }
        /// <summary>
        /// 电池类别
        /// </summary>
        public List<string> ng_class { get; set; }
        /// <summary>
        /// 电池等级
        /// </summary>
        public List<string> ng_classname { get; set; }
        /// <summary>
        /// 型号
        /// </summary>
        public string model { get; set; }
    }
    /// <summary>
    /// 获取托盘信息输出结果
    /// </summary>
    public class ResultGetTrayInfo
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 返回码
        /// </summary>
        public int errcode { get; set; }
        /// <summary>
        /// 错误信息
        /// </summary>
        public string errmsg { get; set; }
        /// <summary>
        /// 返回结果
        /// </summary>
        public ResultGetTrayInfoRtval rtval { get; set; }
    }
    #endregion

    #region 上传工序开始
    public class SetProcessStart
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 工序编码
        /// </summary>
        public string process_code { get; set; }
        /// <summary>
        /// 接口参数
        /// </summary>
        public GetTrayInfoParam param { get; set; }
    }
    #endregion

    #region 上传托盘结果数据
    public class SetProcessResultParam
    {
        /// <summary>
        /// 托盘号
        /// </summary>
        public string tray { get; set; }
        /// <summary>
        /// 设备编码
        /// </summary>
        public List<string> Time { get; set; }
    }
    public class SetProcessResult
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// ？？？？？
        /// </summary>
        public string process_code { get; set; }
        /// <summary>
        /// 接口参数
        /// </summary>
        public SetProcessResultParam param { get; set; }
    }
    #endregion

    #region 获取单电池等级信息（扫单电池，拿等级信息做比对）
    public class BatteryParam
    {
        /// <summary>
        /// 电池编码
        /// </summary>
        public List<string> battery_ids { get; set; }
    }
    public class GetBatteryInfo
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 接口参数
        /// </summary>
        public BatteryParam param { get; set; }
    }
    public class RtvalItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string batch { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string lot { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string tray { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string @class { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string classname { get; set; }
    }
    public class ResultGetBatteryInfo
    {
        /// <summary>
        /// 
        /// </summary>
        public string action { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int errcode { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string errmsg { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<RtvalItem> rtval { get; set; }
    }
    #endregion
}
